package com.hsgene.user.domain;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.hsgene.common.util.date.TimeJsonDeserializer;

import java.util.Date;

/**
 * 第三方OAuth2.0登录认证信息Entry
 *
 * @author wangbing
 * @version 1.0, 2018/6/28
 */
public class UserOAuth {

    /**
     * 用户id
     */
    private String userId;

    /**
     * 用户类型
     */
    private String userType;

    /**
     * OAuth认证中心（第三方类型）
     */
    private String oauthType;

    /**
     * 授权Token
     */
    private String accessToken;

    /**
     * 授权Token过期时间
     */
    private Long expire;

    /**
     * 刷新Token
     */
    private String refreshToken;

    /**
     * 授权用户唯一标识
     */
    private String openId;

    /**
     * 同一个开发平台下,多个应用的unionId一致
     */
    private String unionId;

    /**
     * 授权域
     */
    private String scope;

    /**
     * 授权登录用户信息
     */
    private String oauthUserInfo;

    /**
     * 创建时间
     */
    @JsonDeserialize(using = TimeJsonDeserializer.class)
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonDeserialize(using = TimeJsonDeserializer.class)
    private Date updateTime;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    public String getOauthType() {
        return oauthType;
    }

    public void setOauthType(String oauthType) {
        this.oauthType = oauthType;
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public Long getExpire() {
        return expire;
    }

    public void setExpire(Long expire) {
        this.expire = expire;
    }

    public String getRefreshToken() {
        return refreshToken;
    }

    public void setRefreshToken(String refreshToken) {
        this.refreshToken = refreshToken;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getUnionId() {
        return unionId;
    }

    public void setUnionId(String unionId) {
        this.unionId = unionId;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public String getOauthUserInfo() {
        return oauthUserInfo;
    }

    public void setOauthUserInfo(String oauthUserInfo) {
        this.oauthUserInfo = oauthUserInfo;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
